package com.huluobo.a2308douyindemo.shop

import com.huluobo.a2308douyindemo.databinding.FragmentDetailBinding
import com.huluobo.a2308douyindemo.mvvm.BaseFragment

class DetailFragment : BaseFragment<FragmentDetailBinding, ShopViewModel>() {
    override fun initData() {
        //由于详情的Fragment和详情的Activity使用的是同一个ViewModel,所以可以实现数据共享
        //在当前Fragment中同样可以观察到GoodsLiveData的数据变化
        vm.getGoodsDetailSuccess.observe(this) {
            binding.goods = it.data
        }
    }

    override fun initView() {
    }
}